<?php
require_once WEB_MODEL_DIR . DIRECTORY_SEPARATOR . 'DAO' . DIRECTORY_SEPARATOR . 'GameDAO.php';
require_once WEB_MODEL_DIR . DIRECTORY_SEPARATOR . 'DAO' . DIRECTORY_SEPARATOR . 'GameTagDAO.php';
require_once WEB_MODEL_DIR . DIRECTORY_SEPARATOR . 'DAO' . DIRECTORY_SEPARATOR . 'GameLinkDAO.php';
require_once WEB_MODEL_DIR . DIRECTORY_SEPARATOR . 'DAO' . DIRECTORY_SEPARATOR . 'GameOnlineLinkDAO.php';
require_once WEB_MODEL_DIR . DIRECTORY_SEPARATOR . 'DAO' . DIRECTORY_SEPARATOR . 'DeviceDAO.php';

class GameService {

    public function getGameByParentTPG($context, $result, $parent, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByParentTPG($parent, $start, $limit);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No Game Found For Category : " . $parent);
                $context -> logError('ERR01', 'No Game Found For Category : ' . $parent . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameTempTPG($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameTempTPG();
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No Game Found For Category : ");
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameTempTPGtoMMBG($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameTempTPGtoMMBG();
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No Game Found For Category : ");
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameByParentMobile($context, $result, $parent, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByParentMobile($parent, $start, $limit);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No Game Found For Category : " . $parent);
                $context -> logError('ERR01', 'No Game Found For Category : ' . $parent . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameByParentAndTypeMobile($context, $result, $parent, $type) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByParentAndTypeMobile($parent, $type);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No Game Found For Category : " . $parent);
                $context -> logError('ERR01', 'No Game Found For Category : ' . $parent . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameByParentAndTypeTPG($context, $result, $parent, $type) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByParentAndTypeTPG($parent, $type);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No Game Found For Category : " . $parent);
                $context -> logError('ERR01', 'No Game Found For Category : ' . $parent . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameByParentAndTypeCGMB($context, $result, $parent, $type) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByParentAndTypeCGMB($parent, $type);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No Game Found For Category : " . $parent);
                $context -> logError('ERR01', 'No Game Found For Category : ' . $parent . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameByParentAndTypeMMBG($context, $result, $parent, $type) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByParentAndTypeMMBG($parent, $type);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No Game Found For Category : " . $parent);
                $context -> logError('ERR01', 'No Game Found For Category : ' . $parent . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameByParentAndTypeNSGT($context, $result, $parent, $type) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByParentAndTypeNSGT($parent, $type);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No Game Found For Category : " . $parent);
                $context -> logError('ERR01', 'No Game Found For Category : ' . $parent . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
 	public function getGameByParentCGMB($context, $result, $parent, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByParentCGMB($parent, $start, $limit);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No Game Found For Category : " . $parent);
                $context -> logError('ERR01', 'No Game Found For Category : ' . $parent . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
 	public function getGameByParentMMBG($context, $result, $parent, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByParentMMBG($parent, $start, $limit);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No Game Found For Category : " . $parent);
                $context -> logError('ERR01', 'No Game Found For Category : ' . $parent . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
 	public function getGameByParentNSGT($context, $result, $parent, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByParentNSGT($parent, $start, $limit);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No Game Found For Category : " . $parent);
                $context -> logError('ERR01', 'No Game Found For Category : ' . $parent . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function countFullGame($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> countFullGame();

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function countFullGameTPG($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> countFullGameTPG();

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function countFullGameMobile($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> countFullGameMobile();

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function countFullGameCGMB($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> countFullGameCGMB();

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function countFullGameMMBG($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> countFullGameMMBG();

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function countFullGameNSGT($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> countFullGameNSGT();

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGameByLimitTPG($context, $result, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getFullGameByLimitTPG($start, $limit);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGameByLimitMobile($context, $result, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getFullGameByLimitMobile($start, $limit);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGameByLimitCGMB($context, $result, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getFullGameByLimitCGMB($start, $limit);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGameByLimitMMBG($context, $result, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getFullGameByLimitMMBG($start, $limit);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGameByLimitNSGT($context, $result, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getFullGameByLimitNSGT($start, $limit);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGame($context, $result, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getFullGame($start, $limit);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGame1($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getFullGame1();

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
    public function getGameTagByTagId($context, $result, $tagId) {
        $gameTagArr = null;
        try {
            $gameTagDAO = new GameTagDAO($context);

            $gameTagArr = $gameTagDAO -> getGameTagByTagId($tagId);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameTagArr;
    }

    public function getAllGame($context, $result, $limit = null) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getAllGame($limit);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getAllGameMMBG($context, $result, $limit = null) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getAllGameMMBG($limit);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getAllGameMobile($context, $result, $limit = null) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getAllGameMobile($limit);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }

    public function getFullGameOnline($context, $result, $limit = null) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getFullGameOnline($limit);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGameByParentID($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getFullGameByParentID();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }

	public function countGameByEventTPG($context, $result, $isEvent) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByEventTPG($isEvent);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameByEventMobile($context, $result, $isEvent) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByEventMobile($isEvent);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameByEventCGMB($context, $result, $isEvent) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByEventCGMB($isEvent);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameByEventMMBG($context, $result, $isEvent) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByEventMMBG($isEvent);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameByEventNSGT($context, $result, $isEvent) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByEventNSGT($isEvent);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function getGameByIsGame($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByIsGame();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameArr;
    }
    
    public function getGameEventTPG($context, $result, $isEvent, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameEventTPG($isEvent, $start, $limit);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameEventMobile($context, $result, $isEvent, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameEventMobile($isEvent, $start, $limit);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameEventCGMB($context, $result, $isEvent, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameEventCGMB($isEvent, $start, $limit);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameEventMMBG($context, $result, $isEvent, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameEventMMBG($isEvent, $start, $limit);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameEventNSGT($context, $result, $isEvent, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameEventNSGT($isEvent, $start, $limit);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGameTag($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameTagDAO($context);

            $gameArr = $gameDAO -> getFullGameTag();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGameTagTPG($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameTagDAO($context);

            $gameArr = $gameDAO -> getFullGameTagTPG();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGameTagMobile($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameTagDAO($context);

            $gameArr = $gameDAO -> getFullGameTagMobile();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGameTagCGMB($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameTagDAO($context);

            $gameArr = $gameDAO -> getFullGameTagCGMB();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGameTagMMBG($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameTagDAO($context);

            $gameArr = $gameDAO -> getFullGameTagMMBG();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getFullGameTagNSGT($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameTagDAO($context);

            $gameArr = $gameDAO -> getFullGameTagNSGT();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }

    public function countGameByParentTPG($context, $result, $parent) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByParentTPG($parent);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameByParentMobile($context, $result, $parent) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByParentMobile($parent);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameByParentCGMB($context, $result, $parent) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByParentCGMB($parent);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameByParentMMBG($context, $result, $parent) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByParentMMBG($parent);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameByParentNSGT($context, $result, $parent) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByParentNSGT($parent);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }

    public function getGameByIDCGMB($context, ServiceResult $result, $id) {
        $game = null;
        try {
            $gameDAO = new GameDAO($context);

            $game = $gameDAO -> getGameByIDCGMB($id);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR02", "No Game Found With ID : " . $id);
                $context -> logError("ERR02", "No Game Found With ID : " . $id . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $game;
    }
    
	public function getGameByIDMMBG($context, ServiceResult $result, $id) {
	        $game = null;
        try {
            $gameDAO = new GameDAO($context);

            $game = $gameDAO -> getGameByIDMMBG($id);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR02", "No Game Found With ID : " . $id);
                $context -> logError("ERR02", "No Game Found With ID : " . $id . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $game;
    }
    
	public function getGameByIDTPG($context, ServiceResult $result, $id) {
        $game = null;
        try {
            $gameDAO = new GameDAO($context);

            $game = $gameDAO -> getGameByIDTPG($id);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR02", "No Game Found With ID : " . $id);
                $context -> logError("ERR02", "No Game Found With ID : " . $id . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $game;
    }
    
	public function getGameByIDMobile($context, ServiceResult $result, $id) {
        $game = null;
        try {
            $gameDAO = new GameDAO($context);

            $game = $gameDAO -> getGameByIDMobile($id);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR02", "No Game Found With ID : " . $id);
                $context -> logError("ERR02", "No Game Found With ID : " . $id . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $game;
    }
    
	public function getGameByIDNSGT($context, ServiceResult $result, $id) {
        $game = null;
        try {
            $gameDAO = new GameDAO($context);

            $game = $gameDAO -> getGameByIDNSGT($id);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR02", "No Game Found With ID : " . $id);
                $context -> logError("ERR02", "No Game Found With ID : " . $id . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $game;
    }

	public function countGameByHotStarTPG($context, $result, $hotStar) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByHotStarTPG($hotStar);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameByHotStarMobile($context, $result, $hotStar) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByHotStarMobile($hotStar);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameByHotStarCGMB($context, $result, $hotStar) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByHotStarCGMB($hotStar);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameByHotStarMMBG($context, $result, $hotStar) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByHotStarMMBG($hotStar);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameByHotStarNSGT($context, $result, $hotStar) {
        $total = 0;
        try {
            $gameDAO = new GameDAO($context);

            $total = $gameDAO -> countGameByHotStarNSGT($hotStar);

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
    public function getGameByHotStarTPG($context, $result, $hotStar, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByHotStarTPG($hotStar, $start, $limit);

            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR03", "No Game Of This Hot Star");
                $context -> logError("ERR03", "No Game Of This Hot Star" . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameByHotStarMobile($context, $result, $hotStar, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByHotStarMobile($hotStar, $start, $limit);

            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR03", "No Game Of This Hot Star");
                $context -> logError("ERR03", "No Game Of This Hot Star" . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameByHotStarCGMB($context, $result, $hotStar, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByHotStarCGMB($hotStar, $start, $limit);

            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR03", "No Game Of This Hot Star");
                $context -> logError("ERR03", "No Game Of This Hot Star" . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameByHotStarMMBG($context, $result, $hotStar, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByHotStarMMBG($hotStar, $start, $limit);

            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR03", "No Game Of This Hot Star");
                $context -> logError("ERR03", "No Game Of This Hot Star" . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }
    
	public function getGameByHotStarNSGT($context, $result, $hotStar, $start, $limit) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameByHotStarNSGT($hotStar, $start, $limit);

            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR03", "No Game Of This Hot Star");
                $context -> logError("ERR03", "No Game Of This Hot Star" . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }

    public function getGameMessage($context, $result, $id) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getGameMessage($id);
            if (isset($gameArr) && !empty($gameArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR04", "No Game Message With Game Id : " . $id);
                $context -> logError("ERR04", "No Game Message With Game Id : " . $id . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameArr;
    }

    public function getGameLink($context, $result, $id) {
        $resultGameLink = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameLinkArr = $gameDAO -> getGameLink($id);
            if (isset($gameLinkArr) && !empty($gameLinkArr)) {
                $resultGameLink = array();
                foreach($gameLinkArr as $gameLink)
                {
                    $gameType = $gameLink['type'];
                    $gameDeviceId = $gameLink['device_id'];
                    $fileType = $gameLink['file_type'];
                    $deviceName = !empty($gameLink['device_name']) ? $gameLink['device_name'] : 'Táº¥t cáº£ cÃ¡c dÃ²ng mÃ¡y ' . $gameType;

                    $gameDeviceArr = array();
                    $resultGameLink[$gameType][$gameDeviceId]['device_name'] = $deviceName;
                    $resultGameLink[$gameType][$gameDeviceId]['gameLinkArr'][$fileType] = $gameLink;
                }
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR05", "No Game Link With Game Id " . $id);
                $context -> logError("ERR05", "No Game Link With Game Id " . $id . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        if ($resultGameLink != null)
            $resultGameLink = Tool::sortArrayByDefinedKey($resultGameLink, array('JAVA', 'ANDROID', 'IOS', 'Tá»° Ä�á»˜NG NHáº¬N Dáº NG THIáº¾T Bá»Š'));
        return $resultGameLink;
    }

    public function getGameLinkByGameId($context, $result, $id) {
        $resultGameLink = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByGameId($id);
            if (isset($gameLinkArr) && !empty($gameLinkArr)) {
                $resultGameLink = array();
                foreach($gameLinkArr as $gameLink)
                {
                    $gameType = $gameLink['type'];
                    $gameDeviceId = $gameLink['device_id'];
                    $fileType = $gameLink['file_type'];
                    $deviceName = !empty($gameLink['device_name']) ? $gameLink['device_name'] : 'Táº¥t cáº£ cÃ¡c dÃ²ng mÃ¡y ' . $gameType;

                    $gameDeviceArr = array();
                    $resultGameLink[$gameType][$gameDeviceId]['device_name'] = $deviceName;
                    $resultGameLink[$gameType][$gameDeviceId]['gameLinkArr'][$fileType] = $gameLink;
                }
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR05", "No Game Link With Game Id " . $id);
                $context -> logError("ERR05", "No Game Link With Game Id " . $id . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $resultGameLink;
    }

    public function getGameLinkMin($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameLinkArr = $gameDAO -> getGameLink($id);
            if (isset($gameLinkArr) && !empty($gameLinkArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR06", "No Game Link Min With Game ID : " . $id);
                $context -> logError("ERR06", "No Game Link Min With Game ID : " . $id . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameLinkArr;
    }

    public function getGameOnlineLinkByGameCategoryId($context, $result, $id) {
        $gameLink = null;
        try {
            $gameOnlineLinkDAO = new GameOnlineLinkDAO($context);

            $gameLink = $gameOnlineLinkDAO -> getGameOnlineLinkByGameCategoryId($id);
            if (isset($gameLink) && !empty($gameLink)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR06", "No Game Link Min With Game ID : " . $id);
                $context -> logError("ERR06", "No Game Link Min With Game ID : " . $id . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameLink;
    }

    public function getAllGameLink($context, $result) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getAllGameLink();
            if (isset($gameLinkArr) && !empty($gameLinkArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR07", "Have No Any Game Link");
                $context -> logError("ERR07", "Have No Any Game Link" . " Call By Method " . __METHOD__ . " On Class " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $gameLinkArr;
    }

    public function increaseView($context, $result, $id, $view) {
        try {
            $gameDAO = new GameDAO($context);
            $gameDAO -> increaseView($id, $view);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
            return false;
        }
        return true;
    }
    
    public function updateEvent($context, $result, $id, $eventStatus) {
        try {
            $gameDAO = new GameDAO($context);
            $gameDAO -> updateEvent($id, $eventStatus);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
            return false;
        }
        return true;
    }
    
	public function insertGame($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> insertGame($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function insertGameMMBG($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> insertGameMMBG($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function insertGameTemp($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> insertGameTemp($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function updateLongDetailGameTemp($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> updateLongDetailGameTemp($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function updateLongDetailMMBGGameTemp($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> updateLongDetailMMBGGameTemp($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function updateLongDetailGameTPG($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> updateLongDetailGameTPG($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function updateLongDetailGameCGMB($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> updateLongDetailGameCGMB($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function updateLongDetailGameMMBG($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> updateLongDetailGameMMBG($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function updateLongDetailGameNSGT($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> updateLongDetailGameNSGT($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function updateLongDetailGameMobile($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> updateLongDetailGameMobile($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function insertGameMobile($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> insertGameMobile($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function updateGameNSGT($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> updateGameNSGT($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function updateGameTPG($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> updateGameTPG($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function updateGameMobile($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> updateGameMobile($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function updateGameCGMB($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> updateGameCGMB($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function updateGameMMBG($context, $result, $param) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> updateGameMMBG($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function deleteGameCGMB($context, $result, $id) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> deleteGameCGMB($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function deleteGameTemp($context, $result) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> deleteGameTempTPG();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function deleteGameMMBGTempTPG($context, $result) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> deleteGameMMBGTempTPG();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function deleteGameMMBG($context, $result, $id) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> deleteGameMMBG($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function deleteGameTPG($context, $result, $id) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> deleteGameTPG($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function deleteGameMobile($context, $result, $id) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> deleteGameMobile($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function deleteGameNSGT($context, $result, $id) {
        try {

            $gameDAO = new GameDAO($context);

            $gameDAO -> deleteGameNSGT($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
    
	public function getAllGameLinkByLimitTPG($context, $result, $start, $limit) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getAllGameLinkByLimitTPG($start, $limit);
            
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getAllGameLinkByLimitMobile($context, $result, $start, $limit) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getAllGameLinkByLimitMobile($start, $limit);
            
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getAllGameLinkByLimitCGMB($context, $result, $start, $limit) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getAllGameLinkByLimitCGMB($start, $limit);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getAllGameLinkByLimitMMBG($context, $result, $start, $limit) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getAllGameLinkByLimitMMBG($start, $limit);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getAllGameLinkByLimitNSGT($context, $result, $start, $limit) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getAllGameLinkByLimitNSGT($start, $limit);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function countGameLinkTPG($context, $result) {
        $total = 0;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $total = $gameLinkDAO -> countGameLinkTPG();

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameLinkCGMB($context, $result) {
        $total = 0;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $total = $gameLinkDAO -> countGameLinkCGMB();

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameLinkMobile($context, $result) {
        $total = 0;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $total = $gameLinkDAO -> countGameLinkMobile();

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameLinkNSGT($context, $result) {
        $total = 0;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $total = $gameLinkDAO -> countGameLinkNSGT();

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $total;
    }
    
	public function countGameLinkMMBG($context, $result) {
        $total = 0;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $total = $gameLinkDAO -> countGameLinkMMBG();

        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $total;
    }
    
	public function getGameLinkByGameCateIdTPG($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByGameCateIdTPG($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getGameLinkByGameCateIdMobile($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByGameCateIdMobile($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getGameLinkByGameCateIdCGMB($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByGameCateIdCGMB($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getGameLinkByGameCateIdMMBG($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByGameCateIdMMBG($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getGameLinkByGameCateIdNSGT($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByGameCateIdNSGT($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getGameLinkByGameIdNSGT($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByGameIdNSGT($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getGameLinkByGameIdMMBG($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByGameIdMMBG($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getGameLinkByGameIdCGMB($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByGameIdCGMB($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getGameLinkByGameIdTPG($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByGameIdTPG($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getGameLinkByGameIdMobile($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByGameIdMobile($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getFullDevice($context, $result) {
        $deviceArr = null;
        try {
            $deviceDAO = new DeviceDAO($context);

            $deviceArr = $deviceDAO -> getFullDevice();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $deviceArr;
    }
    
	public function getFullDeviceCGMB($context, $result) {
        $deviceArr = null;
        try {
            $deviceDAO = new DeviceDAO($context);

            $deviceArr = $deviceDAO -> getFullDeviceCGMB();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $deviceArr;
    }
    
	public function getFullDeviceMMBG($context, $result) {
        $deviceArr = null;
        try {
            $deviceDAO = new DeviceDAO($context);

            $deviceArr = $deviceDAO -> getFullDeviceMMBG();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $deviceArr;
    }
    
	public function getFullDeviceNSGT($context, $result) {
        $deviceArr = null;
        try {
            $deviceDAO = new DeviceDAO($context);

            $deviceArr = $deviceDAO -> getFullDeviceNSGT();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $deviceArr;
    }
    
	public function getGameLinkByIDTPG($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByIDTPG($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getGameLinkByIDCGMB($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByIDCGMB($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getGameLinkByIDMMBG($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByIDMMBG($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function getGameLinkByIDNSGT($context, $result, $id) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> getGameLinkByIDNSGT($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function insertGameLink($context, $result,$param) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> insertGameLink($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function insertGameLinkMobile($context, $result,$param) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> insertGameLinkMobile($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function insertGameLinkMMBG($context, $result,$param) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> insertGameLinkMMBG($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function updateGameLinkTPG($context, $result,$param) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> updateGameLinkTPG($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function updateGameLinkCGMB($context, $result,$param) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> updateGameLinkCGMB($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function updateGameLinkMMBG($context, $result,$param) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> updateGameLinkMMBG($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function updateGameLinkNSGT($context, $result,$param) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> updateGameLinkNSGT($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function updateEventByExpireDate($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> updateEventByExpireDate();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameArr;
    }
    
	public function updateGameLinkAjaxTPG($context, $result,$param) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> updateGameLinkAjaxTPG($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function updateGameLinkAjaxCGMB($context, $result,$param) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> updateGameLinkAjaxCGMB($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function updateGameLinkAjaxMobile($context, $result,$param) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> updateGameLinkAjaxMobile($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function updateGameLinkAjaxMMBG($context, $result,$param) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> updateGameLinkAjaxMMBG($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function updateGameLinkAjaxNSGT($context, $result,$param) {
        $gameLinkArr = null;
        try {
            $gameLinkDAO = new GameLinkDAO($context);

            $gameLinkArr = $gameLinkDAO -> updateGameLinkAjaxNSGT($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameLinkArr;
    }
    
	public function updateGameAjaxNSGT($context, $result,$param) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> updateGameAjaxNSGT($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameArr;
    }
    
	public function updateGameAjaxMMBG($context, $result,$param) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> updateGameAjaxMMBG($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameArr;
    }
    
	public function updateGameAjaxCGMB($context, $result,$param) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> updateGameAjaxCGMB($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameArr;
    }
    
	public function updateGameAjaxTPG($context, $result,$param) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> updateGameAjaxTPG($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameArr;
    }
    
	public function updateGameAjaxMobile($context, $result,$param) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> updateGameAjaxMobile($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameArr;
    }
    
	public function getSubsribeAll($context, $result) {
        $gameArr = null;
        try {
            $gameDAO = new GameDAO($context);

            $gameArr = $gameDAO -> getSubsribeAll();
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $gameArr;
    }
    
    
}
?>